package users.examples.beans;

import java.util.Map;


public final class DatabaseParameters {
	
	private Map<ParameterKey, String> connectionValues;
	
	public DatabaseParameters(Map<ParameterKey, String> connectionValues) {
		this.connectionValues = connectionValues;
	}

	public final Map<ParameterKey, String> getConnectionValues() {
		return connectionValues;
	}
	
	public String getConnectionString() {
		final String connection = connectionValues.get(ParameterKey.CONNECTION);
		return (connection == null) ? "" : connection;				
	}
	
	public String getPassword() {
		final String password = connectionValues.get(ParameterKey.PASSWORD);
		return (password == null) ? "" : password;		
	}
	
	public String getUsername() {
		final String username = connectionValues.get(ParameterKey.USERNAME);
		return (username == null) ? "" : username;
	}

}
